package com.newly.center.business;

import com.newly.common.core.utils.SpringContextUtil;
import com.newly.driver.mqtt.utils.MqttUtils;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * @author sbq
 * @date 2021/10/25 11:49
 * @desc 业务服务启动类
 */
@SpringBootApplication
@ComponentScan(basePackages = "com.newly")
@EnableFeignClients(basePackages = {
        "com.newly.api",
        "com.newly.driver.mqtt"
})
@MapperScan("com.newly.common.mapper")
@EnableScheduling
public class NewlyBusinessStart {
    public static void main(String[] args) {
        ApplicationContext applicationContext = SpringApplication.run(NewlyBusinessStart.class, args);
        SpringContextUtil.applicationContext = applicationContext;
        MqttUtils.mqttInit();
        MqttUtils.batchSubTopic("+");
    }
}
